#include <iostream>




int main(int argc, char *argv[], char *env[])
{
    for (int i = 0; i < 3; i++)
        printf("&argv[%d] = %p\n", i, &argv[i]);
    for (int i = 0; i < 3; i++)
        printf("&env[%d] = %p\n", i, &env[i]);
    return 0;
}


/*
int g_unval;
int g_val = 100;

int main()
{
    printf("code addr: %p\n", main);
    printf("init data addr: %p\n", &g_val);
    printf("uninit data addr: %p\n", &g_unval);

    char *heap = (char*)malloc(20);
    char *heap1 = (char*)malloc(20);
    char *heap2 = (char*)malloc(20);
    char *heap3 = (char*)malloc(20);
    static int c;
    printf("heap addr: %p\n", heap);
    printf("heap1 addr: %p\n", heap1);
    printf("heap2 addr: %p\n", heap2);
    printf("heap3 addr: %p\n", heap3);

    printf("stak addr: %p\n", &heap);
    printf("stak addr: %p\n", &heap1);
    printf("stak addr: %p\n", &heap2);
    printf("stak addr: %p\n", &heap3);

    return 0;
}

int main()
{
    const char *myenv = getenv("hello");
    if (myenv == nullptr)
        std::cout << "getenv get nullptr\n";
    else
        std::cout << "myenv = " << myenv << std::endl;

    extern char **environ;
    for (int i = 0; environ[i]; i++)
        std::cout << "environ[" << i << "]: " << environ[i] << std::endl;
    return 0;
}
*/

